package com.zjj.spring.read.xml.aop.aspectjaop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;

public class GreetingAspect {
	
	public void beforeTest(JoinPoint jp) throws Throwable {
		
		System.out.println(" --- GreetingAspect before hello : " + "" + " --- : 被增强的方法名 : " + jp.getSignature().getName());
	}
	
	/**
	 * ProceedingJoinPoint 仅支持around增强,不可用在其他增强方法处
	 * @param pjp
	 * @return
	 * @throws Throwable
	 */
	public Object around(ProceedingJoinPoint pjp) throws Throwable {
		
		System.out.println(" --- GreetingAspect around-befor hello : " + "" + " --- : 被增强的方法名 : " + pjp.getSignature().getName());
		Object result = pjp.proceed();
		System.out.println(" --- GreetingAspect around-after hello : " + "" + " --- : 被增强的方法名 : " + pjp.getSignature().getName());
		return result;	
	}

}
